package com.gccloud.design.feign;

import com.gccloud.design.vo.SysRoleGroupVO;
import com.gccloud.feign.filter.FeignRequestFilter;
import com.gccloud.starter.common.vo.R;
import com.gccloud.starter.core.vo.SysUserVO;
import com.gccloud.starter.core.vo.UserOrgInfoVO;
import com.gccloud.starter.mybatis.page.PageVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * Created by IntelliJ IDEA.
 *
 * @Author : HuangLe
 * @create 2021/12/13 21:40
 */
@FeignClient(
        name = "${idc.user-center.name:userCenter}",
        contextId = "rolegroup",
        path = "${idc.user-center.path:userCenter}/sys/rolegroup",
        configuration = {FeignRequestFilter.class}
)
public interface SysRoleGroupClient {
    @GetMapping({"/getHavePermissionUser"})
    R<PageVO<SysUserVO>> getHavePermissionUser(@RequestParam("current") Integer current, @RequestParam("size") Integer size, @RequestParam("searchKey") String searchKey);

    @GetMapping
    R<PageVO<SysRoleGroupVO>> getPage(@RequestParam("current") Integer current, @RequestParam("size") Integer size, @RequestParam("orgId") String orgId, @RequestParam("searchKey") String searchKey);

    @GetMapping("/rolegroup")
    R<List<UserOrgInfoVO>> query(@RequestParam("current") Integer current, @RequestParam("size") Integer size, @RequestParam("orgId") String orgId, @RequestParam("searchKey") String searchKey);

    @GetMapping("/getUserOrgInfoByRoleGroup/{query}")
    R<List<UserOrgInfoVO>> getUserOrgInfoByRoleGroup(@PathVariable("query") String query);

    /**
     * 根据机构id、工位编码获取用户信息
     */
    @GetMapping("/getUserOrgInfoLikeGroupCode")
    public R<List<UserOrgInfoVO>> getUserOrgInfoLikeGroupCode(@RequestParam("orgId") Integer orgId,
                                                              @RequestParam("groupCode") String groupCode);

}
